﻿using CozeDomain.Entities;
using CozeDto.AdminDtos;
using D.UtilCore.Dtos;
using D.UtilFreesqlOrm;

namespace CozeDomain.IServices
{
    /// <summary>
    /// 系统管理员参数接口
    /// </summary>
    public interface ISysAdminService : IBaseService<SysAdminEntity>
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="reqAddAdmin"></param>
        /// <returns></returns>
        Task<ApiResult<int>> AddAdminAsync(ReqAddAdmin reqAddAdmin);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task<ApiResult<int>> DeleteAdminAsync(List<string> ids);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="reqUpdateAdmin"></param>
        /// <returns></returns> 
        Task<ApiResult<int>> UpdateAdminAsync(ReqUpdateAdmin reqUpdateAdmin);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="reqUpdatePwd"></param>
        /// <returns></returns>
        Task<ApiResult<int>> UpdatePwdAsync(ReqUpdatePwd reqUpdatePwd);

        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="reqChangeStatus"></param>
        /// <returns></returns>
        Task<ApiResult<int>> ChangeStatusAsync(ReqChangeStatus reqChangeStatus);

        /// <summary>
        /// 单个查询
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns> 
        Task<ApiResult<RepAdminInfo>> GetAdminAsync(string id);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="reqQueryAdminPage"></param>
        /// <returns></returns>
        Task<ApiResult<PageModel<RepAdminPageInfo>>> QueryAdminPagesAsync(ReqQueryAdminPage reqQueryAdminPage);

        /// <summary>
        /// 普通登录
        /// </summary>
        /// <param name="account"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        Task<ApiResult<string>> LoginAsync(string account, string pwd);

        /// <summary>
        /// 刷新token
        /// </summary>
        /// <param name="account"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        Task<ApiResult<string>> RefreshTokenAsync(string token);

        /// <summary>
        /// 微信小程序登录
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<ApiResult<string>> WxLoginAsync(string code);
    }
}
